🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonTest / kotlin / org / meshtastic / core / ui / component / LoraSignalIndicatorUiTest.kt
Displaying Raw • Download
core/ui/src/commonTest/kotlin/org/meshtastic/core/ui/component/LoraSignalIndicatorUiTest.kt 9613ba91a7e169afe8ce2e98c6d384ef37f03421 (9613ba91) Text, 2.41 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component
Tff7b72import T7ee787androidx.compose.ui.test.ExperimentalTestApi
Tff7b72import T7ee787androidx.compose.ui.test.assertIsDisplayed
Tff7b72import T7ee787androidx.compose.ui.test.onNodeWithContentDescription
Tff7b72import T7ee787androidx.compose.ui.test.onNodeWithText
Tff7b72import T7ee787androidx.compose.ui.test.v2.runComposeUiTest
Tff7b72import T7ee787org.meshtastic.core.ui.theme.AppTheme
Tff7b72import T7ee787kotlin.test.Test
Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalTestApiTff7b72::Te6edf3classTb4b4b4)
Tff7b72class T56d364LoraSignalIndicatorUiTest Tb4b4b4{
Tf0883e@Test
Tff7b72fun Td2a8ffrssiUsesCallerProvidedLabelTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3runComposeUiTest Tb4b4b4{
Te6edf3setContent Tb4b4b4{ Te6edf3AppTheme Tb4b4b4{ Te6edf3RssiTb4b4b4(Te6edf3rssi Tff7b72= Tff7b72-T79c0ff7T79c0ff0Tb4b4b4, Te6edf3label Tff7b72= Ta5d6ff"Ta5d6ffSignal strengthTa5d6ff"Tb4b4b4) Tb4b4b4} Tb4b4b4}
Te6edf3onNodeWithTextTb4b4b4(Ta5d6ff"Ta5d6ffSignal strength -70 dBmTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3assertIsDisplayedTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ffsnrRendersAZeroReadingTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3runComposeUiTest Tb4b4b4{
T8b949e// 0 dB is a measurement and must be shown, not suppressed as "no reading".
Te6edf3setContent Tb4b4b4{ Te6edf3AppTheme Tb4b4b4{ Te6edf3SnrTb4b4b4(Te6edf3snr Tff7b72= T79c0ff0fTb4b4b4) Tb4b4b4} Tb4b4b4}
Te6edf3onNodeWithTextTb4b4b4(Ta5d6ff"Ta5d6ffSNR 0.00 dBTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3assertIsDisplayedTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ffsnrRendersNothingWhenAbsentTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3runComposeUiTest Tb4b4b4{
Te6edf3setContent Tb4b4b4{ Te6edf3AppTheme Tb4b4b4{ Te6edf3SnrTb4b4b4(Te6edf3snr Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4} Tb4b4b4}
Te6edf3onNodeWithTextTb4b4b4(Ta5d6ff"Ta5d6ffSNR 0.00 dBTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3assertDoesNotExistTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ffloraSignalIndicatorShowsUnknownWhenSnrIsAbsentTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3runComposeUiTest Tb4b4b4{
T8b949e// Absence must not render as "Signal None" — that band means a measured, undemodulable signal.
Te6edf3setContent Tb4b4b4{ Te6edf3AppTheme Tb4b4b4{ Te6edf3LoraSignalIndicatorTb4b4b4(Te6edf3snr Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4} Tb4b4b4}
Te6edf3onNodeWithTextTb4b4b4(Ta5d6ff"Ta5d6ffSignal UnknownTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3assertIsDisplayedTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ffbatteryUsesCallerProvidedUnknownLabelTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3runComposeUiTest Tb4b4b4{
Te6edf3setContent Tb4b4b4{ Te6edf3AppTheme Tb4b4b4{ Te6edf3MaterialBatteryInfoTb4b4b4(Te6edf3level Tff7b72= Tff7b72nullTb4b4b4, Te6edf3unknownLabel Tff7b72= Ta5d6ff"Ta5d6ffUnavailableTa5d6ff"Tb4b4b4) Tb4b4b4} Tb4b4b4}
Te6edf3onNodeWithContentDescriptionTb4b4b4(Ta5d6ff"Ta5d6ffUnavailableTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3assertIsDisplayedTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.07s